/*
 * @Author: 小封 258234579@qq.com
 * @Date: 2022-07-07 17:03:55
 * @LastEditors: 小封 258234579@qq.com
 * @LastEditTime: 2022-07-08 17:08:29
 * @FilePath: \三花机联网\src\api\index.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import request from '@/utils/request'
import qs from "qs";

// 获取设备列表
export const GetDeviceList = (query)=> {
    return request({
      url: 'Device/GetDeviceList',
      method: 'get',
      params: query
    })
}

// 获取设备详情
export const GetDeviceDetail = (query)=> {
    return request({
      url: 'Device/GetDeviceDetail',
      method: 'get',
      params: query
    })
}

// 新增/编辑设备
export const AddOrUpdateDevice = (query)=> {
    return request({
      url: 'Device/AddOrUpdateDevice', 
      method: 'get',
      params:query
    })
}

// 删除设备
export const DelDevice = (query)=> {
  console.log(query);
  return request({
    url: 'Device/DelDevice', 
    method: 'get',
    params:query
  })
}




//程序

//获取程序列表
export const GetProgramList = (query)=> {
  return request({
    url: 'Program/GetProgramList', 
    method: 'get',
    params:query
  })
}

//新增/编辑程序
export const AddOrUpdateProgram = (query)=> {
  return request({
    url: 'Program/AddOrUpdateProgram', 
    method: 'post',
    params:query
  })
}

//文件上传
export const UploadFile = (query)=> {
  return request({
    url: 'Public/UploadFile', 
    method: 'post',
    data:query
  })
}

//获取程序文件列表
export const GetProgramFileList = (query)=> {
  return request({
    url: 'Program/GetProgramFileList', 
    method: 'get',
    params:query
  })
}

//删除程序
export const DelProgram = (query)=> {
  return request({
    url: 'Program/DelProgram', 
    method: 'get',
    params:query
  })
}

//删除程序文件
export const DelProgramFile = (query)=> {
  return request({
    url: 'Program/DelProgramFile', 
    method: 'get',
    params:query
  })
}

//程序下发
export const IssuedProgram = (query)=> {
  return request({
    url: 'Program/IssuedProgram', 
    method: 'post',
    params:query,
  })
}

//获取字典表
export const GetDictionary = (query)=> {
  return request({
    url: 'Public/GetDictionary', 
    method: 'post',
    params:query,
  })
}

//三、采集模块

//获取设备状态列表
export const GetDeviceStatusList = (query)=> {
  return request({
    url: 'Collect/GetDeviceStatusList', 
    method: 'post',
    params:query,
  })
}

//获取设备运行详情
export const GetDeviceStatusDetail = (query)=> {
  return request({
    url: 'Collect/GetDeviceStatusDetail', 
    method: 'post',
    params:query,
  })
}
